/**
 * 帮助界面
 * by wyy 
 */
class helpScene extends GameObject implements eui.UIComponent {
    public background: eui.Rect;
    public windowGrp: eui.Group;
    public btn: eui.Button;
    public textGrp: eui.Group;
    public textField:eui.Group;

    heightPercent = 1;
    widthPercent = 1;

    constructor() {
        super();
        this.skinName = "resource/eui_skins/game_skins/helpSceneSkin.exml";
    }
    addToStage() { }
    firstCreate() {
        let t: egret.TextField = new egret.TextField();
        t.size = 30;
        t.lineSpacing = 14;
        t.width = this.textField.width;
        t.textFlow = (new egret.HtmlTextParser).parser(
            '<font color="#ffffff"  >\n</font>'+
            '<font color="#ffffff">第一轮：</font><font color="#FFFF66">15:00-15:05\n</font>' +
            '<font color="#ffffff">第二轮：</font><font color="#FFFF66">15:10-15:15\n</font>' +
            '<font color="#ffffff">第三轮：</font><font color="#FFFF66">15:20-15:25\n</font>' +
            '<font color="#ffffff">\n①第一轮每桌随机分配10/11人，第二、三轮平均分配每桌人数\n</font>' +
            '<font color="#ffffff">②每人有2次机会，一次掷2颗，<font color="#FFFF66">加和2次骰子（一共4颗）点数</font>\n</font>' +
            '<font color="#ffffff">③每桌骰子点数加和<font color="#FFFF66">前3名</font>为每轮中奖者，可参与下轮博饼\n</font>' +
            '<font color="#ffffff">\n注：\n</font>' +
            '<font color="#ffffff">①出现总点数相同时，<font color="#FFFF66">比较大点数的骰子数量</font>，多者为胜\n</font>' +
            '<font color="#ffffff">②出现完全相同点数的情况，<font color="#FFFF66">比较掷骰时间</font>，先者为胜\n</font>' +
            '<font color="#ffffff">③第三轮将设置两档奖品，一档奖品附赠<font color="#FFFF66">尾牙抽奖券1张</font>\n</font>' +
            '<font color="#ffffff">④附赠的尾牙抽奖券仅增加抽奖概率，若尾牙出现两次中奖以第一次中奖为准\n</font>' +
            '<font color="#FFFF66" size= "34"><b>\n⑤若未在规定时间内参与线上博饼，则视为弃权</b>\n</font>' 

        );
        this.textField.addChild(t);
        this.textField.height = t.height + 20;

        this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { SceneManager.getInstance().closeWindow() }, this);
    }
    onRemove() { }
    childrenResize() {
        this.childResize({ xPercent: 0.5, yPercent: 0.5, heightPercent: 0.9 }, this.windowGrp);
    }
}